#ifndef VFSYSTEM_A_H_INCLUDED
#define VFSYSTEM_A_H_INCLUDED

#include <vfsystem.h>

inode_Err VFS_I_Blockcreate(i_node* _root,i_node* node,i_mode _mode);
void      VFS_InitialliseInderLevels(indPtr* levels);
size_t    VFS_CalculateAllocSize(size_t _objsize);
i_node*   VFS_CreateBaseinodeData(char* name);

/*Function creates and initiallize position of some inderection level( its 1st argument is &N_directArr[ind_level])*/
inode_Err VFS_Createinderlevels(indPtr* indArr,ind_lvl level);
/*Help function of VFS_write, write byte by of data*/
inode_Err write_pos(i_node* _node,size_t _position,void* _onechar);
/*Accept the some node and full PATH for new Folder and separate it in PATH without last part.
Uses the VFS_LookupEntry to check is the the PATH exist and if yes returns the i_node last part of PATH.
INOUT char* _newinodePATH- is the last part from initial PATH1 , which the name for new i_node*/
i_node* VFS_PATHpreparing(char* PATH1,INOUT char* _newinodePATH);
/*Accept the some node and full PATH, if PATH exist returns i_node of last directory in PATH
 and null if not exists */
i_node* VFS_LookupEntry(i_node* _node,char* _PATH);
/*Return 0 if OK*/
inode_Err VFS_UpdateParentDirectory(i_node*_parnt);
/*Help functions of VFS_mkdir, insert the _node to the parent node wich I_Block provided as 1st argument*/
inode_Err VFS_Insert2Parent(I_Block* _blck,i_node** _node);
/*Help function of VFS_mkdir and VFS_Create()*/
i_node* VFS_CreateInodes(char* _name,i_mode _mode,i_node* _parnt,inode_Err* err1);
/*Help function of  VFS_FindPTR , accept on of Inderects levels from I_Block->N_directArr[I_N_LEVELS] seeks
for i_node with name fitted to /subPATH/, returns adress of i_node if found and 0 otherwise*/
indPtr VFS_FindPTR(indPtr _indPTR,ind_lvl _level,char* subPATH);
/*Help function of VFS_LookupEtry accept the I_Block of some node and check does it contain the subPATH
is the -one folder /subPATH/ returns the i_node with this name, or null if not found*/
i_node*   VFS_LookInSubdirect(I_Block*_blk, char* subPATH);
i_node** VFS_LookInSubdirectPTR(I_Block*_blk, char* subPATH);/*the same as above exept of returns value*/
/*Help functions of VFS_Getpos*/
int    VFS_GetIndexInLevel(int* _pos);
/*Help functions of VFS_Getpos*/
indPtr    VFS_FindbyIndexPTR(indPtr _indPTR,size_t _index,ind_lvl _level);
/*Accept the index and i_node returns the sub i_node at corresponded index and null if index outof bounds*/
void**   VFS_Getpos(i_node* _node,int _pos);
/*Print conten of node*/
void printcontent(i_node* _node);

#endif /* VFSYSTEM_A_H_INCLUDED*/
